using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Text.RegularExpressions;
using System.Threading;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Schema;
using ns20;
using ns21;

namespace Newtonsoft.Json
{
	public class JsonValidatingReader : JsonReader, IJsonLineInfo
	{
		private class Class92
		{
			private readonly JTokenType jtokenType_0;

			private readonly IList<Class121> ilist_0;

			private readonly Dictionary<string, bool> dictionary_0;

			[CompilerGenerated]
			private string string_0;

			[CompilerGenerated]
			private int int_0;

			[CompilerGenerated]
			private bool bool_0;

			[CompilerGenerated]
			private bool bool_1;

			[CompilerGenerated]
			private IList<JToken> ilist_1;

			[CompilerGenerated]
			private JTokenWriter jtokenWriter_0;

			[CompilerGenerated]
			private static Func<string, string> func_0;

			[CompilerGenerated]
			private static Func<string, bool> func_1;

			[CompilerGenerated]
			private static Func<Class121, bool> func_2;

			[CompilerGenerated]
			private static Func<KeyValuePair<string, Class121>, bool> func_3;

			[CompilerGenerated]
			private static Func<KeyValuePair<string, Class121>, string> func_4;

			public string String_0
			{
				[CompilerGenerated]
				get
				{
					return string_0;
				}
				[CompilerGenerated]
				set
				{
					string_0 = value;
				}
			}

			public int Int32_0
			{
				[CompilerGenerated]
				get
				{
					return int_0;
				}
				[CompilerGenerated]
				set
				{
					int_0 = value;
				}
			}

			public bool Boolean_0
			{
				[CompilerGenerated]
				get
				{
					return bool_0;
				}
				[CompilerGenerated]
				set
				{
					bool_0 = value;
				}
			}

			public bool Boolean_1
			{
				[CompilerGenerated]
				get
				{
					return bool_1;
				}
				[CompilerGenerated]
				set
				{
					bool_1 = value;
				}
			}

			public IList<JToken> IList_0
			{
				[CompilerGenerated]
				get
				{
					return ilist_1;
				}
				[CompilerGenerated]
				set
				{
					ilist_1 = value;
				}
			}

			public JTokenWriter JTokenWriter_0
			{
				[CompilerGenerated]
				get
				{
					return jtokenWriter_0;
				}
				[CompilerGenerated]
				set
				{
					jtokenWriter_0 = value;
				}
			}

			public IList<Class121> IList_1 => ilist_0;

			public Dictionary<string, bool> Dictionary_0 => dictionary_0;

			public JTokenType JTokenType_0 => jtokenType_0;

			public Class92(JTokenType tokenType, IList<Class121> schemas)
			{
				jtokenType_0 = tokenType;
				ilist_0 = schemas;
				dictionary_0 = schemas.SelectMany(method_0).Distinct().ToDictionary((string string_1) => string_1, (string string_1) => false);
				if (tokenType == JTokenType.Array && schemas.Any((Class121 class121_0) => class121_0.Boolean_6))
				{
					Boolean_0 = true;
					IList_0 = new List<JToken>();
				}
			}

			private IEnumerable<string> method_0(Class121 class121_0)
			{
				if (class121_0 != null && class121_0.IDictionary_0 != null)
				{
					return from keyValuePair_0 in class121_0.IDictionary_0
						where keyValuePair_0.Value.Boolean_0
						select keyValuePair_0.Key;
				}
				return Enumerable.Empty<string>();
			}

			[CompilerGenerated]
			private static string smethod_0(string string_1)
			{
				return string_1;
			}

			[CompilerGenerated]
			private static bool smethod_1(string string_1)
			{
				return false;
			}

			[CompilerGenerated]
			private static bool smethod_2(Class121 class121_0)
			{
				return class121_0.Boolean_6;
			}

			[CompilerGenerated]
			private static bool smethod_3(KeyValuePair<string, Class121> keyValuePair_0)
			{
				return keyValuePair_0.Value.Boolean_0;
			}

			[CompilerGenerated]
			private static string smethod_4(KeyValuePair<string, Class121> keyValuePair_0)
			{
				return keyValuePair_0.Key;
			}
		}

		private readonly JsonReader jsonReader_0;

		private readonly Stack<Class92> stack_0;

		private JsonSchema jsonSchema_0;

		private Class121 class121_0;

		private Class92 class92_0;

		private ValidationEventHandler validationEventHandler_0;

		private static readonly IList<Class121> ilist_0 = new List<Class121>();

		[CompilerGenerated]
		private static Func<Class121, bool> func_0;

		[CompilerGenerated]
		private static Func<Class121, bool> func_1;

		[CompilerGenerated]
		private static Func<Class121, bool> func_2;

		[CompilerGenerated]
		private static Func<KeyValuePair<string, bool>, bool> func_3;

		[CompilerGenerated]
		private static Func<KeyValuePair<string, bool>, string> func_4;

		public override object Object_0 => jsonReader_0.Object_0;

		public override int Int32_0 => jsonReader_0.Int32_0;

		public override string String_0 => jsonReader_0.String_0;

		public override char Char_0
		{
			get
			{
				return jsonReader_0.Char_0;
			}
			protected internal set
			{
			}
		}

		public override JsonToken JsonToken_0 => jsonReader_0.JsonToken_0;

		public override Type Type_0 => jsonReader_0.Type_0;

		private IList<Class121> IList_0 => class92_0.IList_1;

		private IList<Class121> IList_1
		{
			get
			{
				if (class92_0 == null)
				{
					return new List<Class121>(new Class121[1] { class121_0 });
				}
				if (class92_0.IList_1 != null && class92_0.IList_1.Count != 0)
				{
					switch (class92_0.JTokenType_0)
					{
					default:
						throw new ArgumentOutOfRangeException("TokenType", "Unexpected token type: {0}".smethod_0(CultureInfo.InvariantCulture, class92_0.JTokenType_0));
					case JTokenType.None:
						return class92_0.IList_1;
					case JTokenType.Object:
					{
						if (class92_0.String_0 == null)
						{
							throw new JsonReaderException("CurrentPropertyName has not been set on scope.");
						}
						IList<Class121> list2 = new List<Class121>();
						{
							foreach (Class121 item in IList_0)
							{
								if (item.IDictionary_0 != null && item.IDictionary_0.TryGetValue(class92_0.String_0, out var value))
								{
									list2.Add(value);
								}
								if (item.IDictionary_1 != null)
								{
									foreach (KeyValuePair<string, Class121> item2 in item.IDictionary_1)
									{
										if (Regex.IsMatch(class92_0.String_0, item2.Key))
										{
											list2.Add(item2.Value);
										}
									}
								}
								if (list2.Count == 0 && item.Boolean_4 && item.Class121_0 != null)
								{
									list2.Add(item.Class121_0);
								}
							}
							return list2;
						}
					}
					case JTokenType.Array:
					{
						IList<Class121> list = new List<Class121>();
						{
							foreach (Class121 item3 in IList_0)
							{
								if (!item3.Boolean_3)
								{
									if (item3.IList_1 != null && item3.IList_1.Count > 0)
									{
										list.Add(item3.IList_1[0]);
									}
								}
								else
								{
									if (item3.IList_1 != null && item3.IList_1.Count > 0 && item3.IList_1.Count > class92_0.Int32_0 - 1)
									{
										list.Add(item3.IList_1[class92_0.Int32_0 - 1]);
									}
									if (item3.Boolean_5 && item3.Class121_1 != null)
									{
										list.Add(item3.Class121_1);
									}
								}
							}
							return list;
						}
					}
					case JTokenType.Constructor:
						return ilist_0;
					}
				}
				return ilist_0;
			}
		}

		public JsonSchema Schema
		{
			get
			{
				return jsonSchema_0;
			}
			set
			{
				if (JsonToken_0 != 0)
				{
					throw new InvalidOperationException("Cannot change schema while validating JSON.");
				}
				jsonSchema_0 = value;
				class121_0 = null;
			}
		}

		public JsonReader Reader => jsonReader_0;

		int IJsonLineInfo.LineNumber => (jsonReader_0 as IJsonLineInfo)?.LineNumber ?? 0;

		int IJsonLineInfo.LinePosition => (jsonReader_0 as IJsonLineInfo)?.LinePosition ?? 0;

		public event ValidationEventHandler ValidationEventHandler
		{
			add
			{
				ValidationEventHandler validationEventHandler = validationEventHandler_0;
				ValidationEventHandler validationEventHandler2;
				do
				{
					validationEventHandler2 = validationEventHandler;
					ValidationEventHandler value2 = (ValidationEventHandler)Delegate.Combine(validationEventHandler2, value);
					validationEventHandler = Interlocked.CompareExchange(ref validationEventHandler_0, value2, validationEventHandler2);
				}
				while ((object)validationEventHandler != validationEventHandler2);
			}
			remove
			{
				ValidationEventHandler validationEventHandler = validationEventHandler_0;
				ValidationEventHandler validationEventHandler2;
				do
				{
					validationEventHandler2 = validationEventHandler;
					ValidationEventHandler value2 = (ValidationEventHandler)Delegate.Remove(validationEventHandler2, value);
					validationEventHandler = Interlocked.CompareExchange(ref validationEventHandler_0, value2, validationEventHandler2);
				}
				while ((object)validationEventHandler != validationEventHandler2);
			}
		}

		private void method_14(Class92 class92_1)
		{
			stack_0.Push(class92_1);
			class92_0 = class92_1;
		}

		private Class92 method_15()
		{
			Class92 result = stack_0.Pop();
			class92_0 = ((stack_0.Count != 0) ? stack_0.Peek() : null);
			return result;
		}

		private void method_16(string string_0, Class121 class121_1)
		{
			string message = (((IJsonLineInfo)this).HasLineInfo() ? (string_0 + " Line {0}, position {1}.".smethod_1(CultureInfo.InvariantCulture, ((IJsonLineInfo)this).LineNumber, ((IJsonLineInfo)this).LinePosition)) : string_0);
			method_17(new JsonSchemaException(message, null, String_0, ((IJsonLineInfo)this).LineNumber, ((IJsonLineInfo)this).LinePosition));
		}

		private void method_17(JsonSchemaException jsonSchemaException_0)
		{
			ValidationEventHandler validationEventHandler = validationEventHandler_0;
			if (validationEventHandler == null)
			{
				throw jsonSchemaException_0;
			}
			validationEventHandler(this, new ValidationEventArgs(jsonSchemaException_0));
		}

		public JsonValidatingReader(JsonReader reader)
		{
			Class204.smethod_2(reader, "reader");
			jsonReader_0 = reader;
			stack_0 = new Stack<Class92>();
		}

		private void method_18(Class121 class121_1)
		{
			if (class121_1 != null)
			{
				JsonSchemaType? jsonSchemaType = method_19();
				if (jsonSchemaType.HasValue && JsonSchemaGenerator.smethod_0(class121_1.JsonSchemaType_1, jsonSchemaType.Value))
				{
					method_16("Type {0} is disallowed.".smethod_0(CultureInfo.InvariantCulture, jsonSchemaType), class121_1);
				}
			}
		}

		private JsonSchemaType? method_19()
		{
			return jsonReader_0.JsonToken_0 switch
			{
				JsonToken.StartObject => JsonSchemaType.Object, 
				JsonToken.StartArray => JsonSchemaType.Array, 
				JsonToken.Integer => JsonSchemaType.Integer, 
				JsonToken.Float => JsonSchemaType.Float, 
				JsonToken.String => JsonSchemaType.String, 
				JsonToken.Boolean => JsonSchemaType.Boolean, 
				JsonToken.Null => JsonSchemaType.Null, 
				_ => null, 
			};
		}

		public override int? ReadAsInt32()
		{
			int? result = jsonReader_0.ReadAsInt32();
			method_20();
			return result;
		}

		public override byte[] ReadAsBytes()
		{
			byte[] result = jsonReader_0.ReadAsBytes();
			method_20();
			return result;
		}

		public override decimal? ReadAsDecimal()
		{
			decimal? result = jsonReader_0.ReadAsDecimal();
			method_20();
			return result;
		}

		public override string ReadAsString()
		{
			string result = jsonReader_0.ReadAsString();
			method_20();
			return result;
		}

		public override DateTime? ReadAsDateTime()
		{
			DateTime? result = jsonReader_0.ReadAsDateTime();
			method_20();
			return result;
		}

		public override DateTimeOffset? ReadAsDateTimeOffset()
		{
			DateTimeOffset? result = jsonReader_0.ReadAsDateTimeOffset();
			method_20();
			return result;
		}

		public override bool Read()
		{
			if (!jsonReader_0.Read())
			{
				return false;
			}
			if (jsonReader_0.JsonToken_0 == JsonToken.Comment)
			{
				return true;
			}
			method_20();
			return true;
		}

		private void method_20()
		{
			if (class121_0 == null)
			{
				Class122 @class = new Class122();
				class121_0 = @class.method_0(jsonSchema_0);
				if (!JsonWriter.smethod_2(jsonReader_0.JsonToken_0))
				{
					method_14(new Class92(JTokenType.None, IList_1));
				}
			}
			switch (jsonReader_0.JsonToken_0)
			{
			case JsonToken.StartObject:
			{
				method_28();
				IList<Class121> schemas2 = IList_1.Where(method_33).ToList();
				method_14(new Class92(JTokenType.Object, schemas2));
				method_21(IList_0);
				break;
			}
			case JsonToken.StartArray:
			{
				method_28();
				IList<Class121> schemas = IList_1.Where(method_32).ToList();
				method_14(new Class92(JTokenType.Array, schemas));
				method_21(IList_0);
				break;
			}
			case JsonToken.StartConstructor:
				method_28();
				method_14(new Class92(JTokenType.Constructor, null));
				method_21(IList_0);
				break;
			case JsonToken.PropertyName:
				method_21(IList_0);
				foreach (Class121 item in IList_0)
				{
					method_30(item);
				}
				break;
			default:
				throw new ArgumentOutOfRangeException();
			case JsonToken.Raw:
				method_28();
				break;
			case JsonToken.Integer:
				method_28();
				method_21(IList_1);
				foreach (Class121 item2 in IList_1)
				{
					method_27(item2);
				}
				break;
			case JsonToken.Float:
				method_28();
				method_21(IList_1);
				foreach (Class121 item3 in IList_1)
				{
					method_29(item3);
				}
				break;
			case JsonToken.String:
				method_28();
				method_21(IList_1);
				foreach (Class121 item4 in IList_1)
				{
					method_26(item4);
				}
				break;
			case JsonToken.Boolean:
				method_28();
				method_21(IList_1);
				foreach (Class121 item5 in IList_1)
				{
					method_25(item5);
				}
				break;
			case JsonToken.Null:
				method_28();
				method_21(IList_1);
				foreach (Class121 item6 in IList_1)
				{
					method_24(item6);
				}
				break;
			case JsonToken.None:
				break;
			case JsonToken.EndObject:
				method_21(IList_0);
				foreach (Class121 item7 in IList_0)
				{
					method_22(item7);
				}
				method_15();
				break;
			case JsonToken.EndArray:
				method_21(IList_0);
				foreach (Class121 item8 in IList_0)
				{
					method_23(item8);
				}
				method_15();
				break;
			case JsonToken.EndConstructor:
				method_21(IList_0);
				method_15();
				break;
			case JsonToken.Undefined:
			case JsonToken.Date:
			case JsonToken.Bytes:
				method_21(IList_1);
				break;
			}
		}

		private void method_21(IList<Class121> ilist_1)
		{
			foreach (Class92 item in stack_0)
			{
				bool flag;
				if (!(flag = item.JTokenType_0 == JTokenType.Array && item.Boolean_0 && item.Int32_0 > 0) && !item.Boolean_1 && !ilist_1.Any((Class121 class121_1) => class121_1.IList_2 != null))
				{
					continue;
				}
				if (item.JTokenWriter_0 == null)
				{
					if (JsonWriter.smethod_1(jsonReader_0.JsonToken_0))
					{
						continue;
					}
					item.JTokenWriter_0 = new JTokenWriter();
				}
				item.JTokenWriter_0.WriteToken(jsonReader_0, writeChildren: false);
				if (item.JTokenWriter_0.Top != 0 || jsonReader_0.JsonToken_0 == JsonToken.PropertyName)
				{
					continue;
				}
				JToken token = item.JTokenWriter_0.Token;
				item.JTokenWriter_0 = null;
				if (flag)
				{
					if (item.IList_0.Contains(token, JToken.EqualityComparer))
					{
						method_16("Non-unique array item at index {0}.".smethod_0(CultureInfo.InvariantCulture, item.Int32_0 - 1), item.IList_1.First((Class121 class121_1) => class121_1.Boolean_6));
					}
					item.IList_0.Add(token);
				}
				else
				{
					if (!item.Boolean_1 && !ilist_1.Any((Class121 class121_1) => class121_1.IList_2 != null))
					{
						continue;
					}
					foreach (Class121 item2 in ilist_1)
					{
						if (item2.IList_2 != null && !item2.IList_2.smethod_6(token, JToken.EqualityComparer))
						{
							StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture);
							token.WriteTo(new JsonTextWriter(stringWriter));
							method_16("Value {0} is not defined in enum.".smethod_0(CultureInfo.InvariantCulture, stringWriter.ToString()), item2);
						}
					}
				}
			}
		}

		private void method_22(Class121 class121_1)
		{
			if (class121_1 == null)
			{
				return;
			}
			Dictionary<string, bool> dictionary_ = class92_0.Dictionary_0;
			if (dictionary_ != null)
			{
				List<string> list = (from keyValuePair_0 in dictionary_
					where !keyValuePair_0.Value
					select keyValuePair_0.Key).ToList();
				if (list.Count > 0)
				{
					method_16("Required properties are missing from object: {0}.".smethod_0(CultureInfo.InvariantCulture, string.Join(", ", list.ToArray())), class121_1);
				}
			}
		}

		private void method_23(Class121 class121_1)
		{
			if (class121_1 != null)
			{
				int int32_ = class92_0.Int32_0;
				if (class121_1.Nullable_6.HasValue && int32_ > class121_1.Nullable_6)
				{
					method_16("Array item count {0} exceeds maximum count of {1}.".smethod_1(CultureInfo.InvariantCulture, int32_, class121_1.Nullable_6), class121_1);
				}
				if (class121_1.Nullable_5.HasValue && int32_ < class121_1.Nullable_5)
				{
					method_16("Array item count {0} is less than minimum count of {1}.".smethod_1(CultureInfo.InvariantCulture, int32_, class121_1.Nullable_5), class121_1);
				}
			}
		}

		private void method_24(Class121 class121_1)
		{
			if (class121_1 != null && method_34(class121_1, JsonSchemaType.Null))
			{
				method_18(class121_1);
			}
		}

		private void method_25(Class121 class121_1)
		{
			if (class121_1 != null && method_34(class121_1, JsonSchemaType.Boolean))
			{
				method_18(class121_1);
			}
		}

		private void method_26(Class121 class121_1)
		{
			if (class121_1 == null || !method_34(class121_1, JsonSchemaType.String))
			{
				return;
			}
			method_18(class121_1);
			string text = jsonReader_0.Object_0.ToString();
			if (class121_1.Nullable_1.HasValue && text.Length > class121_1.Nullable_1)
			{
				method_16("String '{0}' exceeds maximum length of {1}.".smethod_1(CultureInfo.InvariantCulture, text, class121_1.Nullable_1), class121_1);
			}
			if (class121_1.Nullable_0.HasValue && text.Length < class121_1.Nullable_0)
			{
				method_16("String '{0}' is less than minimum length of {1}.".smethod_1(CultureInfo.InvariantCulture, text, class121_1.Nullable_0), class121_1);
			}
			if (class121_1.IList_0 == null)
			{
				return;
			}
			foreach (string item in class121_1.IList_0)
			{
				if (!Regex.IsMatch(text, item))
				{
					method_16("String '{0}' does not match regex pattern '{1}'.".smethod_1(CultureInfo.InvariantCulture, text, item), class121_1);
				}
			}
		}

		private void method_27(Class121 class121_1)
		{
			if (class121_1 == null || !method_34(class121_1, JsonSchemaType.Integer))
			{
				return;
			}
			method_18(class121_1);
			object obj = jsonReader_0.Object_0;
			if (class121_1.Nullable_4.HasValue)
			{
				if (JValue.smethod_7(JTokenType.Integer, obj, class121_1.Nullable_4) > 0)
				{
					method_16("Integer {0} exceeds maximum value of {1}.".smethod_1(CultureInfo.InvariantCulture, obj, class121_1.Nullable_4), class121_1);
				}
				if (class121_1.Boolean_2 && JValue.smethod_7(JTokenType.Integer, obj, class121_1.Nullable_4) == 0)
				{
					method_16("Integer {0} equals maximum value of {1} and exclusive maximum is true.".smethod_1(CultureInfo.InvariantCulture, obj, class121_1.Nullable_4), class121_1);
				}
			}
			if (class121_1.Nullable_3.HasValue)
			{
				if (JValue.smethod_7(JTokenType.Integer, obj, class121_1.Nullable_3) < 0)
				{
					method_16("Integer {0} is less than minimum value of {1}.".smethod_1(CultureInfo.InvariantCulture, obj, class121_1.Nullable_3), class121_1);
				}
				if (class121_1.Boolean_1 && JValue.smethod_7(JTokenType.Integer, obj, class121_1.Nullable_3) == 0)
				{
					method_16("Integer {0} equals minimum value of {1} and exclusive minimum is true.".smethod_1(CultureInfo.InvariantCulture, obj, class121_1.Nullable_3), class121_1);
				}
			}
			if (class121_1.Nullable_2.HasValue)
			{
				bool flag;
				if (obj is BigInteger)
				{
					BigInteger bigInteger = (BigInteger)obj;
					flag = (Math.Abs(class121_1.Nullable_2.Value - Math.Truncate(class121_1.Nullable_2.Value)).Equals(0.0) ? (bigInteger % new BigInteger(class121_1.Nullable_2.Value) != 0L) : (bigInteger != 0L));
				}
				else
				{
					flag = !smethod_3((double)Convert.ToInt64(obj, CultureInfo.InvariantCulture) % class121_1.Nullable_2.Value);
				}
				if (flag)
				{
					method_16("Integer {0} is not evenly divisible by {1}.".smethod_1(CultureInfo.InvariantCulture, JsonConvert.ToString(obj), class121_1.Nullable_2), class121_1);
				}
			}
		}

		private void method_28()
		{
			if (class92_0 == null || class92_0.JTokenType_0 != JTokenType.Array)
			{
				return;
			}
			class92_0.Int32_0++;
			foreach (Class121 item in IList_0)
			{
				if (item != null && item.Boolean_3 && !item.Boolean_5 && (item.IList_1 == null || class92_0.Int32_0 - 1 >= item.IList_1.Count))
				{
					method_16("Index {0} has not been defined and the schema does not allow additional items.".smethod_0(CultureInfo.InvariantCulture, class92_0.Int32_0), item);
				}
			}
		}

		private void method_29(Class121 class121_1)
		{
			if (class121_1 == null || !method_34(class121_1, JsonSchemaType.Float))
			{
				return;
			}
			method_18(class121_1);
			double num = Convert.ToDouble(jsonReader_0.Object_0, CultureInfo.InvariantCulture);
			if (class121_1.Nullable_4.HasValue)
			{
				if (num > class121_1.Nullable_4)
				{
					method_16("Float {0} exceeds maximum value of {1}.".smethod_1(CultureInfo.InvariantCulture, JsonConvert.ToString(num), class121_1.Nullable_4), class121_1);
				}
				if (class121_1.Boolean_2 && num == class121_1.Nullable_4)
				{
					method_16("Float {0} equals maximum value of {1} and exclusive maximum is true.".smethod_1(CultureInfo.InvariantCulture, JsonConvert.ToString(num), class121_1.Nullable_4), class121_1);
				}
			}
			if (class121_1.Nullable_3.HasValue)
			{
				if (num < class121_1.Nullable_3)
				{
					method_16("Float {0} is less than minimum value of {1}.".smethod_1(CultureInfo.InvariantCulture, JsonConvert.ToString(num), class121_1.Nullable_3), class121_1);
				}
				if (class121_1.Boolean_1 && num == class121_1.Nullable_3)
				{
					method_16("Float {0} equals minimum value of {1} and exclusive minimum is true.".smethod_1(CultureInfo.InvariantCulture, JsonConvert.ToString(num), class121_1.Nullable_3), class121_1);
				}
			}
			if (class121_1.Nullable_2.HasValue)
			{
				double double_ = smethod_2(num, class121_1.Nullable_2.Value);
				if (!smethod_3(double_))
				{
					method_16("Float {0} is not evenly divisible by {1}.".smethod_1(CultureInfo.InvariantCulture, JsonConvert.ToString(num), class121_1.Nullable_2), class121_1);
				}
			}
		}

		private static double smethod_2(double double_0, double double_1)
		{
			return double_0 - Math.Floor(double_0 / double_1) * double_1;
		}

		private static bool smethod_3(double double_0)
		{
			return Math.Abs(double_0) < 2.2204460492503131E-15;
		}

		private void method_30(Class121 class121_1)
		{
			if (class121_1 != null)
			{
				string text = Convert.ToString(jsonReader_0.Object_0, CultureInfo.InvariantCulture);
				if (class92_0.Dictionary_0.ContainsKey(text))
				{
					class92_0.Dictionary_0[text] = true;
				}
				if (!class121_1.Boolean_4 && !method_31(class121_1, text))
				{
					method_16("Property '{0}' has not been defined and the schema does not allow additional properties.".smethod_0(CultureInfo.InvariantCulture, text), class121_1);
				}
				class92_0.String_0 = text;
			}
		}

		private bool method_31(Class121 class121_1, string string_0)
		{
			if (class121_1.IDictionary_0 != null && class121_1.IDictionary_0.ContainsKey(string_0))
			{
				return true;
			}
			if (class121_1.IDictionary_1 != null)
			{
				foreach (string key in class121_1.IDictionary_1.Keys)
				{
					if (Regex.IsMatch(string_0, key))
					{
						return true;
					}
				}
			}
			return false;
		}

		private bool method_32(Class121 class121_1)
		{
			if (class121_1 == null)
			{
				return true;
			}
			return method_34(class121_1, JsonSchemaType.Array);
		}

		private bool method_33(Class121 class121_1)
		{
			if (class121_1 == null)
			{
				return true;
			}
			return method_34(class121_1, JsonSchemaType.Object);
		}

		private bool method_34(Class121 class121_1, JsonSchemaType jsonSchemaType_0)
		{
			if (!JsonSchemaGenerator.smethod_0(class121_1.JsonSchemaType_0, jsonSchemaType_0))
			{
				method_16("Invalid type. Expected {0} but got {1}.".smethod_1(CultureInfo.InvariantCulture, class121_1.JsonSchemaType_0, jsonSchemaType_0), class121_1);
				return false;
			}
			return true;
		}

		bool IJsonLineInfo.HasLineInfo()
		{
			return (jsonReader_0 as IJsonLineInfo)?.HasLineInfo() ?? false;
		}

		[CompilerGenerated]
		private static bool smethod_4(Class121 class121_1)
		{
			return class121_1.IList_2 != null;
		}

		[CompilerGenerated]
		private static bool smethod_5(Class121 class121_1)
		{
			return class121_1.Boolean_6;
		}

		[CompilerGenerated]
		private static bool smethod_6(Class121 class121_1)
		{
			return class121_1.IList_2 != null;
		}

		[CompilerGenerated]
		private static bool smethod_7(KeyValuePair<string, bool> keyValuePair_0)
		{
			return !keyValuePair_0.Value;
		}

		[CompilerGenerated]
		private static string smethod_8(KeyValuePair<string, bool> keyValuePair_0)
		{
			return keyValuePair_0.Key;
		}
	}
}
